# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
# Contributor: Vitaliy Berdinskikh ur6lad[at]i.ua

pkgname=tomcat-native
pkgver=1.2.12
pkgrel=1
pkgdesc='Optional component for Tomcat to use certain native resources for performance, compatibility'
arch=('i686' 'x86_64')
url='https://tomcat.apache.org/native-doc/'
license=('APACHE')
depends=('apr')
makedepends=('java-environment')
options=('!emptydirs')
source=(https://archive.apache.org/dist/tomcat/tomcat-connectors/native/${pkgver}/source/${pkgname}-${pkgver}-src.tar.gz{,.asc})
validpgpkeys=('A9C5DF4D22E99998D9875A5110C01C5A2F6059E7')
sha256sums=('e7add177c98a7f07220c306d65e182c45dbcd7501115e9ed56f1690c5472ded9'
            'SKIP')

build() {
  cd "${srcdir}/tomcat-native-${pkgver}-src/native"

  ./configure \
    --prefix=/usr \
    --with-java-home=/usr/lib/jvm/default \
    --with-apr=/usr \
    --with-ssl=/usr
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}-src/native"

  make DESTDIR="${pkgdir}" install
}
